package com.ruoyi.file.service;

import org.apache.tomcat.util.http.fileupload.FileItem;
import org.apache.tomcat.util.http.fileupload.FileItemHeaders;

import java.io.*;

public class MyFileItem implements FileItem {
    private String name;
    private File storeFile;

    public void setName(String name) {
        this.name = name;
    }

    public MyFileItem(File outFile) {
        this.storeFile = outFile;
    }

    @Override
    public OutputStream getOutputStream() throws IOException {
        return new FileOutputStream(storeFile);
    }

    @Override
    public InputStream getInputStream() throws IOException {
        return null;
    }

    @Override
    public String getContentType() {
        return null;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public boolean isInMemory() {
        return false;
    }

    @Override
    public long getSize() {
        return 0;
    }

    @Override
    public byte[] get() throws UncheckedIOException {
        return new byte[0];
    }

    @Override
    public String getString(String encoding) throws UnsupportedEncodingException, IOException {
        return null;
    }

    @Override
    public String getString() {
        return null;
    }

    @Override
    public void write(File file) throws Exception {

    }

    @Override
    public void delete() {

    }

    @Override
    public String getFieldName() {
        return null;
    }

    @Override
    public void setFieldName(String name) {

    }

    @Override
    public boolean isFormField() {
        return false;
    }

    @Override
    public void setFormField(boolean state) {

    }

    @Override
    public FileItemHeaders getHeaders() {
        return null;
    }

    @Override
    public void setHeaders(FileItemHeaders headers) {

    }
}
